\section{Problem 1}

	\subsection*{Question B and C}
	
		\subsubsection*{Explanation of our errors}
		
			When executing our last version of code, some update requests which must failed were still executed. This bug was due to a condition we added. That condition was : \\
			
			\textit{"if the department name of a student or an instructor has not changed then update is executed normally."}.\\
			
			We translate it in SQL like the following condition :
			\begin{verbatim}
				IF NEW.dept_name <> OLD.dept_name THEN
				    ...
				ELSE
				    ...
				END IF;
			\end{verbatim}
			
			But the operator \textit{different of} \verb?<>? can not compare a value to \verb?NULL? in \textbf{PostgreSQL}. So, the condition returns \verb?false? and the update was executed.			
			
		\subsubsection*{Tests results}
		
			Tests results with this correction can be found in appendix.
		
\newpage
\section{Problem 2}

	\subsection*{Explanation of our errors}
	
		When aggregating tables to perform the roll up, we forgot to make the sum on the field quantity of our request to get men's wear and women's wear. Consequently total column is wrong. 
	
	\subsection*{Test results}
	
		Here is test results after correction of those mistakes.
		
		\begin{center}
		

		\begin{verbatim}
		=> select * from sales_rollup;
		
		 clothes_size | color  | menswear | womenswear | total 
--------------+--------+----------+------------+-------
 small        | dark   |       16 |          4 |    20
 medium       | white  |        1 |          8 |     9
 medium       | dark   |       12 |         11 |    23
 small        | white  |       20 |          4 |    24
 medium       | pastel |        1 |         12 |    13
 small        | pastel |        5 |         15 |    20
 large        | white  |       12 |          3 |    15
 large        | dark   |        6 |         13 |    19
 large        | pastel |        3 |         18 |    21
 all          | white  |       33 |         15 |    48
 all          | dark   |       34 |         28 |    62
 all          | pastel |        9 |         45 |    54
 large        | all    |       21 |         34 |    55
 medium       | all    |       14 |         31 |    45
 small        | all    |       41 |         23 |    64
 all          | all    |       76 |         88 |   164
		\end{verbatim}
		\end{center}
		
		
	
		

